# Contributor: prspkt <prspkt@protonmail.com>
# Maintainer: prspkt <prspkt@protonmail.com>
pkgname=py3-pyhamcrest
_pkgname=PyHamcrest
pkgver=2.1.0
pkgrel=1
pkgdesc="Hamcrest framework for matcher objects"
url="https://github.com/hamcrest/PyHamcrest"
arch="noarch"
license="BSD-3-Clause"
depends="python3"
makedepends="py3-gpep517 py3-hatchling py3-hatch-vcs"
checkdepends="py3-hypothesis py3-mock py3-pytest"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/hamcrest/PyHamcrest/archive/V$pkgver.tar.gz"
builddir="$srcdir/"$_pkgname-$pkgver

replaces="py-hamcrest" # Backwards compatibility
provides="py-hamcrest=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	export SETUPTOOLS_SCM_PRETEND_VERSION=$pkgver
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	PYTHONPATH=src \
	pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/pyhamcrest*.whl
}

sha512sums="
99017a75954b346622f9bd261a4f8827f82eb42a19551a7f96f9097a763e57afcc367a41a4cca742bda60ee0e7c3bcc2ca7025348e318f41e67c97c7a60961b5  PyHamcrest-2.1.0.tar.gz
"
